from ninja import Schema, Field, FilterSchema, ModelSchema
from typing import Optional
from rest_framework.serializers import ModelSerializer

from models.models import Goods, GoodType


class AppletGoodFiltersSchema(FilterSchema):
    """商品筛选"""
    name: Optional[str] = Field("", description="名称", q="name__contains")
    price_up: Optional[bool] = Field(None)
    sales_up: Optional[bool] = Field(None)
    type_id: Optional[int] = Field(None, description="类型")
